package com.usian.behavior.controller;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.usian.behavior.mapper.BehaviorEntryMapper;
import com.usian.model.behavior.pojos.ApBehaviorEntry;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("api/v1/behavior")
public class BehaviorEntryController {
    @Autowired
    private BehaviorEntryMapper mapper;

    @GetMapping("get/entry")
    public ApBehaviorEntry getEntry(@RequestParam("userId") Integer userId){
        ApBehaviorEntry behaviorEntry = mapper.selectOne(Wrappers.<ApBehaviorEntry>lambdaQuery().eq(ApBehaviorEntry::getEntryId, userId));
        return behaviorEntry;
    }
}
